package ro.ubbcluj.cs.damate.persistence.repository;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import ro.ubbcluj.cs.damate.persistence.entities.Group;
import ro.ubbcluj.cs.damate.persistence.entities.User;

import java.util.List;

/**
 * @author Lóránd Fazakas (lfazakas)
 *         Date: 2012.04.20.
 *         Time: 20:03
 */
public interface UserRepository extends CrudRepository<User, String> {

    @Query("select e from User e")
    List<User> findAllUsers();

    List<User> findByState(Boolean active);
    List<User> findByGroup(Group group);
    List<User> findByUsernameAndPassword(String username, String password);
}
